<?php

require('httpheader.php');
require('../install/mysqldb.php');


header('Content-Type:application/json; charset=utf-8');

if($_POST){
    $data = $_POST["data"];

    $title = $data['text'];
    $userid = $data['userid'];
    $username = $data['username'];
    $theme = $data['backpostion'];
    $problem = json_encode($data['problem'],JSON_UNESCAPED_UNICODE);
    $results = json_encode($data['results'],JSON_UNESCAPED_UNICODE);
    date_default_timezone_set('PRC');
    $coding = $data['coding'];
    $createtime = time();

}


if($cin){
    mysqli_select_db($cin,"hongbao");
    $userdata = "INSERT INTO userinfo(title,userid,username,theme,coding,createtime,problem,results) VALUES('$title','$userid','$username','$theme','$coding','$createtime','$problem','$results')";
    if(mysqli_query($cin,$userdata)){
        echo "200";
    }
}

?>